import * as types from '../types'
import api from '../../fetch/api'

const state = {
	orderselectindex: "Oticket", //选项卡
	// 订单列表
	res_orderlist: {},
	res_toCheck: {},
	// 订单详情
	res_odetaildata: {
		show: false
	},
	settlementdetails:{
		show: false
	},//结算详情
	settleOrderInfo:{},//财务管理 - 结算单订单详情
	ReqsettleorderDetail:{},//财务管理 - 订单列表订单详情-请求参数
	settleorderDetail:{}//财务管理 - 订单列表订单详情
}
const actions = {
	getorderselectindex({
		dispatch,
		commit
	}, res) {
		commit(types.OR_STA_SELINDEX_DATA, res)
	},
	getres_orderlist({dispatch, commit }, res) {
		commit(types.OR_RES_ORDERLIST_DATA, res)
	},
	getres_toCheck({
		commit }, res) {
		commit(types.OR_RES_TOCHECK_DATA, res)
	},
	getres_odetaildata({
		dispatch,
		commit
	}, res) {
		commit(types.OR_RES_ODETAIL_DATA, res)
	},
	getsettlementdetails({
		dispatch,
		commit
	}, res) {
		commit(types.FM_RES_SETTLEMENTDETAIL_DATA, res)
	},
	getsettleOrderInfo({
		dispatch,
		commit
	}, res) {
		commit(types.FM_RES_SETTLEORDERINFO_DATA, res)
	},
	getReqsettleorderDetail({
		dispatch,
		commit
	}, res) {
		commit(types.FM_REQ_SETTLEORDERDETAIL, res)
	},
	getsettleorderDetail({
		dispatch,
		commit
	}, res) {
		commit(types.FM_RES_SETTLEORDERDETAIL_DATA, res)
	},
	
}

const getters = {
	orderselectindex: state => state.orderselectindex,
	res_orderlist: state => state.res_orderlist,
	res_toCheck: state => state.res_toCheck,
	res_odetaildata: state => state.res_odetaildata,
	settlementdetails:state=>state.settlementdetails,
	settleOrderInfo:state=>state.settleOrderInfo,
	ReqsettleorderDetail:state=>state.ReqsettleorderDetail,
	settleorderDetail:state=>state.settleorderDetail,
}

const mutations = {
	[types.OR_STA_SELINDEX_DATA](state, res) {
		state.orderselectindex = res
	},
	[types.OR_RES_ORDERLIST_DATA](state, res) {
		state.res_orderlist = res
	},
	[types.OR_RES_TOCHECK_DATA](state, res) {
		state.res_toCheck = res
	},
	[types.OR_RES_ODETAIL_DATA](state, res) {
		state.res_odetaildata = res
	},
	[types.FM_RES_SETTLEMENTDETAIL_DATA](state, res) {
		state.settlementdetails = res
	},
	[types.FM_RES_SETTLEORDERINFO_DATA](state, res) {
		state.settleOrderInfo = res
	},
	[types.FM_REQ_SETTLEORDERDETAIL](state, res) {
		state.ReqsettleorderDetail = res
	},
	[types.FM_RES_SETTLEORDERDETAIL_DATA](state, res) {
		state.settleorderDetail = res
	},
}

export default {
	state,
	actions,
	getters,
	mutations
}
